home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / SourceCode / Multi / CircleView.h < prev    next >
Text File  |  1995-06-12  |  1KB  |  42 lines

  1. /*-------------------------------------------------------------------------------
  2.    A simple View subclass that draws a series of circles.  The list of
  3.      circles to be drawn is kept in a Storage object; we just run down
  4.      the list, drawing them.
  5.      
  6.      HISTORY:
  7.          
  8.             10Oct93    DM    New
  9. -------------------------------------------------------------------------------*/
  10.  
  11. #import <appkit/appkit.h>
  12.  
  13.     // Defines the data for a simple circle.  No need for objects here.
  14.     
  15. typedef struct tCircle
  16.     {
  17.         NXPoint    center;
  18.         double    radius;
  19.     } circle;
  20.     
  21.  
  22. @interface CircleView:View
  23. {
  24.     Storage        *circleList;                                    // Storage of all the circles to be drawn
  25. }
  26.  
  27. - initFrame                                                            // Designated initializer for View
  28.     :(const NXRect*)frameRect;
  29.     
  30. - addCircleAt                                                        // Add a circle to the display list
  31.     :(NXPoint)pPoint                                            // INPUT: the center of the circle
  32.         withRadius:(double)pRadius;                    // INPUT: the radius of the circle
  33.  
  34. - emptyCircles;                                                    // Remove all the circles from the display list
  35.         
  36. - drawSelf
  37.         :(const NXRect *)rects 
  38.         :(int)rectCount;
  39.  
  40.  
  41. @end
  42.